require.config({
  paths:{
    'backbone':'./libs/backbone',
    'underscore':'./libs/underscore',
    'jquery':'./libs/jquery',
    'text':'./libs/text',
    'css':'./libs/css',
    'homeJs':'./home/js/home',
    'baidu':'./libs/baiduTemplate',
    'sscsJs':'./sscs/js/sscs',
    'mineJs':'./mine/js/mine'
  }
});

require(['backbone'],function(Backbone){

    var Router=Backbone.Router.extend({
      routes:{
        '':'home',
        'home':'home',
        'mine':'mine',
        'sscs':'sscs',
        'shoppingCar':'shoppingCar'
      },
      home:function(){

        require(['baidu','jquery','text!./home/home.html','homeJs','css!./home/css/home.css'],function(baidu,$,html,homeJs){

          $('.content').html(html);

          homeJs.run();


        })
      },
      mine:function(){
        require(['mineJs','jquery','text!./mine/mine.html','css!./mine/css/mine.css'],function(mineJs,$,html){
          $('.content').html(html);
          mineJs.mine();


        })
      },
      sscs:function(){
        require(['jquery','text!./sscs/sscs.html','sscsJs','css!./sscs/css/sscs.css'],function($,html,sscsJs){
          $('.content').html(html);

          sscsJs.ajax();

        })
      },
      shoppingCar:function(){
        require(['jquery','text!./shoppingCar/shoppingCar.html','css!./shoppingCar/css/shoppingCar.css'],function($,html){
          $('.content').html(html);

        })
      }
    });

    var router=new Router();
    Backbone.history.start();
})
